package com.zhang.goods.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zhang.goods.entity.SpuDescImg;
import com.zhang.goods.mapper.SpuDescImgMapper;
import com.zhang.goods.service.ISpuDescImgService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * spu描述图片 服务实现类
 * </p>
 *
 * @author 创世神
 * @since 2023-10-05
 */
@Service
public class SpuDescImgServiceImpl extends ServiceImpl<SpuDescImgMapper, SpuDescImg> implements ISpuDescImgService {

    @Override
    public SpuDescImg getBySpuId(Long spuId) {
        QueryWrapper<SpuDescImg> wrapper = new QueryWrapper<>();
        wrapper.eq("spu_id", spuId);
        SpuDescImg descImg = getOne(wrapper);
        return descImg;
    }
}
